<HTML><HEAD><TITLE>probe_sched(+Starts, +Durations, +Resources, +MaxResource, ?CostFun)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">library(ic_probing_for_scheduling)</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>probe_sched(+Starts, +Durations, +Resources, +MaxResource, ?CostFun)</H1>
Find a resource-feasible schedule that minimises the
cost function
<DL>
<DT><EM>Starts</EM></DT>
<DD> a list of (n) task start times (integers or
finite domain variables)
</DD>
<DT><EM>Durations</EM></DT>
<DD>a list of (n) task durations (integers or
finite domain variables)
</DD>
<DT><EM>Resources</EM></DT>
<DD>a list of (n) task resource needs (integers or 
finite domain variables)
</DD>
<DT><EM>MaxResource</EM></DT>
<DD>The available resource, not to be exceeded (integer)
</DD>
<DT><EM>CostFun</EM></DT>
<DD>An expression involving start times and durations
to be minimised
</DD>
</DL>
<H2>Description</H2>
<P>
	This predicate finds start times for a set of tasks, which
minimise the value of a given cost function.
</P><P>
The cost function is the only information the search algorithm can use to
focus on the optimum.  It cannot guide the search if the cost is a variable, 
only linked to the tasks start times by constraints.  For this reason the 
cost function admits the special functions <B>abs</B> and <B>maxlist</B>.
</P><P>
The syntax for cost functions is:
<PRE>
CostFunction ::- PosExpr | PosExpr + PosExpr | Integer * PosExpr
PosExpr ::- abs(LinearExpr) | maxlist([LinearExpr]) | LinearExpr.
</PRE>
</P><P>
The algorithm is described in more detail in the documentation of 
<B>probe_cstr_sched/7</B>. 
</P>

<H3>Resatisfiable</H3>
no
<H2>Examples</H2>
<PRE>
probe_schedule(Starts,CostFun) :-
	Starts=[X,Y,Z],
        ic:(Starts::1..10),
        Durations=[10,5,5],
        Resources=[R1,R2,R3],
        ic:(R1::1..2), R2=2, R3=1,
        MaxResource=2,
        [OldX,OldY,OldZ]=[1,5,5],
        CostFun= abs(X-OldX)+abs(Y-OldY)+abs(Z-OldZ),
	probe_sched(Starts,Durations,Resources,MaxResource,CostFun).
</PRE>
<H2>See Also</H2>
<A HREF="../../lib/ic_probing_for_scheduling/probe_cstr_sched-7.html">probe_cstr_sched / 7</A>, <A HREF="../../lib/fd/min_max-2.html">fd : min_max / 2</A>, <A HREF="../../lib/ic_probe/set_up_probe-5.html">ic_probe : set_up_probe / 5</A>, <A HREF="../../lib/probe/set_up_probe-5.html">probe : set_up_probe / 5</A>, <A HREF="../../lib/make_overlap_bivs/make_overlap_bivs-5.html">make_overlap_bivs : make_overlap_bivs / 5</A>, <A HREF="../../lib/ic_make_overlap_bivs/make_overlap_bivs-5.html">ic_make_overlap_bivs : make_overlap_bivs / 5</A>, <A HREF="../../lib/ic_probe_search/probe_search-5.html">ic_probe_search : probe_search / 5</A>, <A HREF="../../lib/probe_search/probe_search-5.html">probe_search : probe_search / 5</A>, <A HREF="../../lib/fd_global/maxlist-2.html">fd_global : maxlist / 2</A>, <A HREF="../../lib/ic_global/maxlist-2.html">ic_global : maxlist / 2</A>, <A HREF="../../lib/ic/maxlist-2.html">ic : maxlist / 2</A>
</BODY></HTML>
